<template>
  <base-option :selected="selected" :field-config="fieldConfig" :form-config="formConfig">
    <template #default="{ hideOptions }">
      <el-form-item v-if="fieldConfig.penColor !== undefined && hideOptions('penColor')" label="笔触颜色">
        <el-input v-model="fieldConfig.penColor" placeholder="#000" />
      </el-form-item>
      <el-form-item v-if="fieldConfig.backgroundColor !== undefined && hideOptions('backgroundColor')" label="背景颜色">
        <el-input v-model="fieldConfig.backgroundColor" placeholder="自定义背景颜色" />
      </el-form-item>

      <el-form-item v-if="fieldConfig.lineWidth !== undefined && hideOptions('lineWidth')" label="线条宽度">
        <el-input-number v-model="fieldConfig.lineWidth" :min="1" :max="9" controls-position="right" />
      </el-form-item>
      <el-form-item v-if="fieldConfig.clearButtonText !== undefined && hideOptions('clearButtonText')" label="清除按钮">
        <el-input v-model="fieldConfig.clearButtonText" placeholder="	清空" />
      </el-form-item>
      <el-form-item
        v-if="fieldConfig.confirmButtonText !== undefined && hideOptions('confirmButtonText')"
        label="确认按钮"
      >
        <el-input v-model="fieldConfig.confirmButtonText" placeholder="确认" />
      </el-form-item>
    </template>
  </base-option>
</template>

<script setup>
import { toRefs } from 'vue'
import baseOption from './base-option.vue'
import propsDefinition from './props'
const props = defineProps(propsDefinition)
const { selected, fieldConfig, formConfig } = toRefs(props)
</script>
